Dlock(2) Mar. 8, 1992 Dlock(2) NAME Dlock - lock or unlock a BIOS disk device SYNOPSIS LONG Dlock( WORD mode, WORD drv ); DESCRIPTION Dlock is used to lock or unlock the BIOS device indicated by drv. No GEMDOS file operations are permitted on a locked drive. Thus, the Dlock call provides a mechanism for disk formatters or re-organizers to lock out other processes while low-level BIOS or XBIOS operations are in progress on the device. If mode is 1, the drive is locked; if it is 0 then the drive is unlocked and may be used again by other programs. If a process terminates while holding a lock on a drive, that drive is automatically unlocked. A lock operation followed immediately by an unlock is very similar to a media change, except that the lock operation will fail if there are open files that refer to the indi- cated drive. RETURNS 0 if the lock/unlock operation was successful EACCDN if mode is 1 and either open files exist on the drive or another process has already locked the drive,or if mode is 0 and the drive was locked by a different process EDRIVE if drv is not a valid BIOS device number SEE ALSO Fxattr(2) NOTES Note that Dlock operates on BIOS devices, which may not always be in 1-1 correspondence with GEMDOS drive letters. For this reason, to lock GEMDOS drive A: (for example), the programmer should call Fxattr on the root directory of A: ("A:\") and then use the dev field of the structure returned in order to determine the BIOS device corresponding to the GEMDOS drive. Version 0.93 Last change: MiNT Programmer's Manual 1